<?php

namespace app\home\controller;

use think\Controller;

class Goods extends Controller
{
    //
    public function list(){
        // 获取参数
        $id = input('id');
        //查询数据
        $categary_state=\app\common\model\Goods::where('id',$id)->select();
        // dump($list);
        // 模板赋值
        return view('list',['goodslist'=>$list,'categary_state']);
    }

    // 详情页
    public function detail(){
        $detaildata=\app\commom\model\Goods::find($id);
        $detaildata['goods_attr']=json_decode($detaildata['oods_attr']);
        return view('detail',['detaildata'=>$detaildata]);
    }
}
